using System.Drawing;
using System.Windows.Forms;
using fitnesstrack.library;

namespace fitnesstrack.win.controls
{
    public partial class BFLWorkoutSubGroup : UserControl
    {
        public BFLWorkoutSubGroup()
        {
            InitializeComponent();
        }

        private bool showHeader = true;

        public bool ShowHeader
        {
            get { return showHeader; }
            set { showHeader = value; }
        }

        private SubCategoryInfo subCategoryInfo;

        public SubCategoryInfo SubCategoryInfo {
            get { return subCategoryInfo; }
            set { subCategoryInfo = value; }
        }

        private void SubGroupNamePanel_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            Brush b = SystemBrushes.ControlText;
            Font f = new Font(SystemFonts.CaptionFont.FontFamily, 18f, FontStyle.Bold);

            g.TranslateTransform(0.0f, TextRenderer.MeasureText(subCategoryInfo.Name, f).Width);
            g.RotateTransform(-90.0f);
            g.DrawString(subCategoryInfo.Name, f, b, 0.0f, 0.0f);
            g.ResetTransform();
        }

        private void panel2_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.DrawLine(SystemPens.ControlDark, 0, this.chooseExerciseLabel.Top-1, this.notesTextBox.Left -2,
                       this.chooseExerciseLabel.Top-1);
        }
    }
}
